//README FOR CRIMES AGAINST MORALITY DATA FILES
//THIS VERSION: OCTOBER 19, 2020; JENNIFER SEAGER 

/**************************************/
/***********FOLDER STRUCTURE***********/
/**************************************/

data - contains the necessary data files for the main analysis
do - contains do files to replicate the figures and tables in both the main paper and the appendix
output - captures the output from the do files
temp - captures a set of temporary files generated during the main figure and table output

/**************************************/
/**************data files**************/
/**************************************/

Crimes-Against-Morality_Main_data-constructed
	main data file for analysis

Crimes-Against-Morality_Child_data-constructed
	to generate analysis in Table V

Crimes-Against-Morality_General-Pop_data-constructed
	data file to generate the General-Pop analysis Table VI

Crimes-Against-Morality_attrition-data
	data file to perform attrition analysis in Paper Figure VII and in the appendix

	//Attrition data is constructed from the Crimes-Against-Morality_Main_data-constructed.dta data file using the following code:
	#delimit;
	preserve;

	keep if dataset==1;
	drop if wave==2;
	tempfile fsw_wave1;
	save `fsw_wave1';

	restore;
	preserve;
	keep if dataset==1;
	drop if wave ==1;
	keep quest ea id sw sept_any;
	tempfile fsw_wave2;
	save `fsw_wave2';

	use `fsw_wave1', clear;
	rename sw sw1;
	rename sept_any sept_any1;
	rename quest quest1;
	merge 1:1 ea id using `fsw_wave2';

	gen attrit_ansamp = panel_v3==0;
	gen attrit_sti = sept_any1!=.&sept_any==. if sept_any1!=.;

	foreach var in married edyrs age children sw_locyrs disc_factor risktol_nodl nodlr 
			   sept_any1 hlthacc condeasy havecondom condomprice cl7day
			   tr7day hr7day earn7day {;
			   
			   gen i_`var'=`var'*closing;
			   
			   };
			   *;

	save "$da/0-public/Crimes-Against-Morality_attrition-data.dta"	, replace;	

*/data/fig 
	Contains excel files used to generate paper figures I and II on the timeline and worksite population sizes


/**************************************/
/**************do files****************/
/**************************************/


0_Crimes-Against_Morality_directory-structure
	use this file to set the directory structure for your machine. The all subsequent files run accordingly
	to replicate the paper and appendix analysis

1_Crimes-Against-Morality_Paper-Tables
	Runs all analysis for the main paper Tables:
	Table I: Summary Statistics: Sex Workers and Clients
	Table II: Effect of Criminalization on Sex Worker Health and Condom use
	Table III: Effect of Criminalzation on Worksite Operations
	Table IV: Effect of Criminalization on Transaction, Sex Worker, and Client Characteristics
	Table V: Effect of Criminalization on Earnings, Well-Being, and Children
	Table VI: Effects of Criminlization on General Population


1_Crimes-Against-Morality_Paper-Figures
	Runs all analysis for the main paper figures except figure IV:
	Figure I: Study Area
	Figure II: Study Timeline
	Figure III: Effect of Criminalization on Sex Worker Population
	Figure V: STI Prevalence by Criminalzation Status
	Figure VI: Estimates of Criminalization Impacts
	Figure VII: Baseline STI Prevalence

1_Crimes-Against-Morality_Susenas-Analysis
	Runs all analysis using the SUSENAS data, including main paper Figure IV and Table I.II in the Online Appendix
	NOTE THAT THE SUSENAS DATA IS NOT PUBLICLY AVAILABLE AND CAN BE PURCHASED
	FROM THE INDONESIAN STATISTICAL AGENCY AT https://www.bps.go.id/

	Figure IV: Comparisons of Trends in Outcomes in Malang with Pasuruan and Batu prior to Criminalization
	Table I.II: Comparison of Sex Workers with General Population Women

2_Crimes-Against-Morality_Paper-Tables-Appendix
	Runs all analysis for the appendix tables except Table I.II
	
	Table I.I Following-up iwth the Female Sex Workers from the Baseline Sample
	Table I.III Baseline Values of Charateristics and Key Outcome Measures, by formal and informal worksites
	Table I.IV Impact of Criminalization on Sex Worker Health and Condom Use, Robustness
	Table I.V Impact of Criminalization on Worksite Operations, Robustness
	Table I.VI Impact of Criminalization on Sex Worker Health, assuming STI rates among sex workes who leave sex work
	Table I.VII Impact of Criminalization on SEx Worker Health and Condom Use, no controls
	Table I.VIII Impact of Characteristics on Condom Use
	Table I.IX Sample Selection and Attrition
	Table I.X Key Outcome Variables by Criminalization and Attrition Status

2_Crimes-Against-Morality_Paper-Figures-Appendix
	Runs all analysis for the appendix figures
	Figure I.I Sample Sizes
	Figure I.II Means of Key Outcome Variables by Criminalization Status

*/Bootstrap
	Contains the do files to calculate the Wild Cluster-bootstrip percentile-t p-values from Cameron, Gelbach, and Miller (2008)





